#!/bin/bash

# ----------------------------------------------------------------------
# Filename:   75563-rpm-ivh-e.sh
# Version:    1.0
# Date:       2013/12/04
# Author:     yuanhui.shi
# Email:      yuanhui.shi@cs2c.com.cn
# Summary:    02系统基本功能-07开发环境-02开发工具-02rpm构建工具-07安装所需软件包和删除软件包
# Notes:      rpm命令
# Copyright:  China Standard Software Co., Ltd.
# History：     
#             Version 1.0, 2013/12/04
#             -   The first one
# ----------------------------------------------------------------------

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

source ../../lib/Echo.sh

source ../../lib/XmlParse.sh


function CleanData ()
{
  #mount | grep "/mnt" && umount /mnt
  #EchoInfo "75563-rpm-ivh-e.sh执行完毕"
  EchoInfo "75563-rpm-ivh-e.sh未执行"
  
}

trap "CleanData" EXIT INT

#判断系统中是否有gcc软件包，如果安装了，可以继续测试
rpm -qa |grep "^gcc-[1-9]"
EchoResult "系统中安装了gcc软件包，可以继续进行测试"

#卸载gcc软件
#rpm -e --nodeps gcc
#[ -z "`rpm -qa |grep ^gcc-[1-9]`" ]
#EchoResult "通过rpm -e命令卸载gcc包"

#安装gcc软件
#mount -o loop ./data/ns6.4-adv-x64-b10.iso /mnt
#rpm -ivh /mnt/Packages/gcc-[1-9]*.rpm &>/dev/null

#[ -n "`rpm -qa |grep ^gcc-[1-9]`" ]
#EchoResult "通过rpm -ivh命令安装gcc包"

exit 1
